package com.braveman.im.ui.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.braveman.im.R;
import com.braveman.im.bean.MyUnitsBean;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.qmuiteam.qmui.widget.QMUIRadiusImageView;

import java.util.List;

/**
 * Created by 昊昊 on 2017/10/12.
 */

/**
 * 我的单位
 */
public class MyUnitsAdapter extends BaseQuickAdapter<MyUnitsBean, BaseViewHolder> {
    private QMUIRadiusImageView qmuiRadiusImageView;
    public MyUnitsAdapter(@LayoutRes int layoutResId, @Nullable List<MyUnitsBean> data) {
        super(R.layout.item_my_units, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MyUnitsBean item) {
        qmuiRadiusImageView = helper.getView(R.id.item_my_units_img);
        qmuiRadiusImageView.setCircle(false);
        helper.setText(R.id.item_my_units_title, item.groupDisplayName);
        Glide.with(mContext).load(item.groupIcon).into(qmuiRadiusImageView);
    }
}
